<?php
defined('_JEXEC') or die('Restricted access');

//add javascript
$js1 = JURI::base().'components/com_nv/assets/js/jquery.js';
$js2= JURI::base().'components/com_nv/assets/js/jquery.bgiframe.min.js';
$js3 = JURI::base().'components/com_nv/assets/js/jquery.ajaxQueue.js';
$js4 = JURI::base().'components/com_nv/assets/js/jquery.autocomplete.js';

//add css
$css1 = JURI::base().'components/com_nv/assets/css/jquery.autocomplete.css';

?>

<script type="text/javascript" src="<?echo $js1 ?>"></script>
<script type="text/javascript" src="<?echo $js2 ?>"></script>
<script type="text/javascript" src="<?echo $js3 ?>"></script>
<script type="text/javascript" src="<?echo $js4 ?>"></script>

<link rel="stylesheet" href="<?echo $css1 ?>" type="text/css" media="screen" />

<script type="text/javascript">
$().ready(function() {

$("#teksinput").autocomplete([

<? foreach($this->list as $list){
	echo "\"".$list->nama."\", ";
}?> ], {
		width: 320,
		max: 4,
		highlight: false,
		multiple: false,
		multipleSeparator: " ",
		scroll: true,
		scrollHeight: 300,
		autoFill: true
	});

});
</script>



<div class="componentheading">Cari Ramalan Cuaca</div>

<form action="<? echo "index.php?option=com_nv&view=weather" ?>" method="post" name="adminForm" id="adminForm">

<table class="admintable">
<tr>
<td>



</td>
<td width="100" align="right" class="key">
<input id="teksinput" name="kota"/>
</td>

<td>
<input name="searchBtn" type="submit" value="cari" />
</td>
</tr>
</table>
</form>


<?	
	if($_POST[kota]){
		
	  foreach($this->data as $weather)
{ ?>

<h1><?echo $weather->title; ?></h1>

<p><? echo "Description : ".$weather->description; ?></p>

<? }
}?>